<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>路由规则管理</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color:  #b2d8d8;
            margin: 0;
            padding: 20px;
        }

        h1 {
            text-align: center;
            color: #333;
        }

        .container {
            max-width: 600px;
            margin: 0 auto;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            padding: 20px;
        }

        .traffic-section {
            display: flex;
            justify-content: space-between;
            margin-bottom: 20px;
            padding: 10px;
            background-color: #e9ecef;
            border-radius: 4px;
        }

        .traffic-section div {
            flex: 1;
            text-align: center;
        }

        .traffic-value {
            font-size: 24px;
            font-weight: bold;
            color: #007bff;
        }

        button {
            padding: 10px 15px;
            background-color: #28a745;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        button:hover {
            background-color: #218838;
        }

        .restart {
            text-align: center;
        }
    </style>
</head>

<body>
    <h1>路由规则管理</h1>
    <div class="container">
        <div class="traffic-section">
            <div>
                <label>上行流量</label>
                <div class="traffic-value" id="upTraffic">0 KB</div>
            </div>
            <div>
                <label>下行流量</label>
                <div class="traffic-value" id="downTraffic">0 KB</div>
            </div>
        </div>
        <div class="restart">
            <button>重启路由</button>
        </div>
    </div>

    <script>
        // 这里可以添加后端数据的获取和显示逻辑
        // 示例: 更新流量数据的函数
        function updateTrafficData(up, down) {
            document.getElementById('upTraffic').innerText = up;
            document.getElementById('downTraffic').innerText = down;
        }

        // 假设从后端获取的数据
        setInterval(() => {
            // 模拟后端数据
            const upTraffic = Math.floor(Math.random() * 1000) + " KB";
            const downTraffic = Math.floor(Math.random() * 1000) + " KB";
            updateTrafficData(upTraffic, downTraffic);
        }, 5000); // 每5秒更新一次数据
    </script>
</body>

</html>
